I have some code that is inserting many rows into the database,
executing Statements repeatedly. I can run the inserts as batches
using the JDBC batch functionality, or I can concatenate the inserts
with semi-colons and execute one large statement.
If I take the semi-colon approach, I cannot use a PreparedStatement
easily, which is fine. I read somewhere that the implementation of
executeBatch() just executes all of the statements one-by-one, which
would be as slow as executing separate statements.
I would like some advice as to which method would run faster and if
using PreparedStatements is a good performance boost.
Is there any limit to the number of statements that can be executed in a batch?
All advice is greatly appreciated.
Thanks.
Jeff